<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
	<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/styles.css" />
	<title>Pacchetti Richiesti</title>
</h:head>

<h:body>
<div id="header">
	<ui:include src="/resources/snippets/headerDipendente.xhtml"></ui:include>
</div>
	<h1> Pacchetti Richiesti</h1>  
    	<h:dataTable value="#{pacchetto.listaPacchetti}" var="paccCurr">
    		<h:column>
    			<f:facet name="header">Destinazione</f:facet>
    			<h:outputText value="#{paccCurr.citta}"/>
    		</h:column>
 			<h:column>
    			<f:facet name="header">Volo di Andata</f:facet>
    			<h:outputText value="#{paccCurr.voloAndata.codice}"/>
    		</h:column>
    		<h:column>
    			<f:facet name="header">Volo di Ritorno</f:facet>
    			<h:outputText value="#{paccCurr.voloRitorno.codice}"/>
    		</h:column>
    		<h:column>
    			<f:facet name="header">(Primo) Hotel</f:facet>
    			<h:outputText value="#{paccCurr.hotels.isEmpty() ? '-nessuno-' : paccCurr.hotels.get(0).nome}"/>
    		</h:column>
    		<h:column>
    			<f:facet name="header">(Prima) Escursione</f:facet>
    			<h:outputText value="#{paccCurr.escursioni.isEmpty() ? '-nessuna-' : paccCurr.escursioni.get(0).luogoInteresse}"/>
    		</h:column>
    		<h:column>
    			<h:form>
					<h:commandButton value="Elimina" action="#{pacchetto.delete(paccCurr)}" styleClass="styleButton"/>
				</h:form>
    		</h:column>
    		<h:column>
    			<h:form>
					<h:commandButton  value="Modifica" action="#{pacchetto.iniziaModifica(paccCurr)}" />
				</h:form>
    		</h:column>
    	</h:dataTable>  
	<br/>
	<br/>
	<br/>
	<h:link outcome="gestionePacchetti" value="Torna a Gestione Pacchetti" />
	<br/>
	<br/>
	<br/>
<div id="footer">
	<ui:include src="/resources/snippets/footer.xhtml"></ui:include>
</div>
</h:body>

</html>